Skip to content

Update service principal creation command and use env variable for Subscription ID - #48

Open
wesmacdonald wants to merge 2 commits into
MicrosoftLearning:mainfrom
wesmacdonald:main
Open

Update service principal creation command and use env variable for Subscription ID#48
wesmacdonald wants to merge 2 commits into
MicrosoftLearning:mainfrom
wesmacdonald:main

Conversation

@wesmacdonald

Copy link
Copy Markdown

Purpose

Reduces some of the friction while going through the lab.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

The first change is related to a policy error generating a password (if the end user has enabled the baseline security mode - 'block new password credentials in apps'. The password is not actually required for the lab so this avoids an error message being displayed.

The second change relates to an end user with multiple Azure Subscriptions; the code is unable to determine which subscription Application Insights is located in and throws 'ERROR: Could not find a matching Application Insights component in your subscription'. The subscription id exists as an environment variable, so this avoids the error all together.

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

How to Test

  1. Create the service principal with the new parameter added to the command line, note no policy error
  2. After running 'azd up', followed by 'azd env get-values > .env' verify check_traces.py in the 'Monitor and trace your generative AI agent' exercise.
  • Test the code

What to Check

Verify that the following are valid

'az ad sp create-for-rbac' command no longer creates a password
python src/tests/check_traces.py finds the correct Application Insights component

Other Information

A few paper cuts I found while doing the exercises.

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.

1 participant