Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds documentation to add service principal #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gurkanindibay
Copy link

No description provided.

@gurkanindibay gurkanindibay requested a review from onurctirtir May 10, 2022 15:08

- If you're having problems on `az login` as below
`AADSTS7000222: The provided client secret keys for app '********************' are expired....`
Then there is a problem related to service principal that is being used in CircleCI azure-cli orb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then there is a problem related to service principal that is being used in CircleCI azure-cli orb
Then there is a problem related to service principal that is being used in CircleCI azure-cli orb.

`AADSTS7000222: The provided client secret keys for app '********************' are expired....`
Then there is a problem related to service principal that is being used in CircleCI azure-cli orb

There are three CircleCI environment variables being used by azure-cli plugin to login
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are three CircleCI environment variables being used by azure-cli plugin to login
There are three CircleCI environment variables being used by azure-cli plugin to login:

- AZURE_SP_TENANT

These three variables are defined by the service principal parameters app_id, client secret and tenant_id respectively.
You can see the definition of the service principal we are using is defined in the link below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can see the definition of the service principal we are using is defined in the link below
You can see the definition of the service principal we are using in the link below:

Comment on lines +876 to +877
If you get the error above, you need to add a new certificate using Certificates & Secrets blade
and change the value of the AZURE_SP_PASSWORD value with the new secret value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you get the error above, you need to add a new certificate using Certificates & Secrets blade
and change the value of the AZURE_SP_PASSWORD value with the new secret value.
If you get the error above, you need to add a new certificate using Certificates & Secrets blade
and change the value of the AZURE_SP_PASSWORD value with the new secret value.

In some cases you may not access the Service Principal since owners could be removed by admins.
In that case you need to add another service principal using the command below after logged in using your credentials

`az ad sp create-for-rbac --name <new_service_provider_name> --role contributor --scope /subscriptions/88abe223-c630-4f2c-8782-00bb5be874f6`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not hardcode subscription id:

Suggested change
`az ad sp create-for-rbac --name <new_service_provider_name> --role contributor --scope /subscriptions/88abe223-c630-4f2c-8782-00bb5be874f6`
`az ad sp create-for-rbac --name <new_service_provider_name> --role contributor --scope /subscriptions/<subscription_id>`

Comment on lines +884 to +889
If you have permission to create service principle, you will get a json string as below

`"appId": "<app_id>",
"displayName": "<new_service_provider_name>",
"password": "<password>",
"tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you have permission to create service principle, you will get a json string as below
`"appId": "<app_id>",
"displayName": "<new_service_provider_name>",
"password": "<password>",
"tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47"`
If you have permission to create service principle, you will get a json string as such:
`"appId": "<app_id>",
"displayName": "<new_service_provider_name>",
"password": "<password>",
"tenant": "<tenant_id>"`

https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps

Then you need to add a client secret using Clients & Secrets. You need to get the appId and client secret value
and update AZURE_SP and AZURE_SP_PASSWORD environment variables on CircleCI with the new appId and client secret value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and update AZURE_SP and AZURE_SP_PASSWORD environment variables on CircleCI with the new appId and client secret value
and update AZURE_SP and AZURE_SP_PASSWORD environment variables on CircleCI with the new appId and client secret value

@onurctirtir
Copy link
Member

Please also not forget to check the preview of the README using the link below, to see how it would look like after merging your pr:
https://github.com/citusdata/test-automation/tree/gindibay_sp_doc_add#-troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants