Skip to content

feat(m365): Use Managed Identity for Getting Application Certificate in Container#6

Merged
jacdavi merged 19 commits intomainfrom
managed_identity
May 24, 2025
Merged

feat(m365): Use Managed Identity for Getting Application Certificate in Container#6
jacdavi merged 19 commits intomainfrom
managed_identity

Conversation

@jacdavi
Copy link
Copy Markdown
Collaborator

@jacdavi jacdavi commented Mar 13, 2025

🗣 Description

Based on new features from Microsoft, this changes how we get the application's certificate inside the container.
With this change, we now use a User-Managed Identity to access key vault instead of passing the certificate as a secure environment variable.
This was previously unsupported when deploying in a vnet.

This also removes a configuration option for certificate expiration.
We no longer need to rotate frequently since the certificate remains in key vault, so the expiration is fixed at 1 year.

This also updates our terraform providers to the latest versions (needed for identities to work).

  • Requires adding subscription ID to provider
  • Some minor variable name changes
  • Requires updating storage references (IDs used to be URLs, but aren't anymore)

💭 Motivation and context

Previously we were passing the application certificate as a secure environment variable to the container.
This was not ideal, and had increased the risk of the certificate being leaked.
Since Microsoft has now added supported for using a Managed Identity inside an Azure Container Instance behind a vnet, this PR switches to using that for key vault access.

🧪 Testing

Tested in westus2 with and without a vnet and verified certificate installed in the container

@jacdavi jacdavi self-assigned this Mar 13, 2025
@jacdavi
Copy link
Copy Markdown
Collaborator Author

jacdavi commented Mar 13, 2025

FYI @MichaelHicks-MSFT and @eagbaya

Everything should be good to go, though I'd like to test in GCC High and confirm Microsoft's update has rolled out to all regions before merging.

@jacdavi jacdavi added blocked This issue or pull request is awaiting the outcome of another issue or pull request improvement This issue or pull request will add new or improve existing functionality gearconnect Relates to GearConnect (m365) labels Mar 15, 2025
@jacdavi jacdavi marked this pull request as draft March 25, 2025 15:59
@jacdavi jacdavi removed the blocked This issue or pull request is awaiting the outcome of another issue or pull request label May 23, 2025
@jacdavi
Copy link
Copy Markdown
Collaborator Author

jacdavi commented May 23, 2025

Removing the blocked label. While we have not heard confirmation from MS that the feature has been fully rolled out, we have not encountered any issues in any of the regions we have tested in and the rollout was originally planned to be finished in March

@jacdavi jacdavi marked this pull request as ready for review May 23, 2025 23:19
@jacdavi jacdavi changed the title Draft: Use Managed Identity for Getting Application Certificate in Container feat(m365): Use Managed Identity for Getting Application Certificate in Container May 23, 2025
@jacdavi jacdavi merged commit 7267c43 into main May 24, 2025
7 checks passed
@jacdavi jacdavi deleted the managed_identity branch September 29, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gearconnect Relates to GearConnect (m365) improvement This issue or pull request will add new or improve existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant