Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Support for Service Principal with certificate (no password) - #32

Open
zioproto wants to merge 2 commits into
Azure-Samples:mainfrom
zioproto:service-principal-certificate
Open

Support for Service Principal with certificate (no password)#32
zioproto wants to merge 2 commits into
Azure-Samples:mainfrom
zioproto:service-principal-certificate

Conversation

@zioproto

@zioproto zioproto commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

Purpose

To support the CodeSpaces scenario: In case you can't create a Service Principal with password (for example because of tenant policy) you need to create a Service Principal with certificate.

Does this introduce a breaking change?

[ ] Yes
[ X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[X ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

Create a service principal with certificate:

az ad sp create-for-rbac --role="Owner" --scopes="/subscriptions/<SUBSCRIPTION_ID>" --create-cert -o json

Populate the CodeSpace secrets:

ARM_CLIENT_ID
ARM_CLIENT_SECRET
ARM_TENANT_ID

The certificate secret must be populated like this:

ARM_CLIENT_CERTIFICATE=$(cat cert-and-private-key.pem| base64)

Follow the tutorial steps in the Readme.

@zioproto
zioproto force-pushed the service-principal-certificate branch 2 times, most recently from 634d0ce to 4300456 Compare March 4, 2024 15:18
@zioproto
zioproto force-pushed the service-principal-certificate branch from 4300456 to eb25c70 Compare March 4, 2024 15:26
Comment thread .devcontainer/script.sh
Comment thread .devcontainer/script.sh
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants