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

Added fixed for case sensitive split and missing workspace name from … #193

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

Conversation

LeonB87
Copy link

@LeonB87 LeonB87 commented Jan 7, 2022

Summary of the Pull Request

There was a small issue in enabling Sentinel on a workspace. Another user also opened an issue for this #192

  • The body of the request contained the text ($workspace) and not the actual workspace resource ID
  • The retrieval of the workspace failed as the splitting of the baseURL failed. Using $var.split("") is case sensitive. Switched to $var -split ("") as this is case insensitive and should prevent any issues.
  • fixed 2 small typo's in output
    ...

PR Checklist

By submitting this pull request, I confirm the following:

please fill any appropriate checkboxes, e.g: [X]

  • Closes Set-Sentinel returns with status code 400 #192
  • Requires documentation to be updated (N/A)
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes, and have included unit tests where possible.
  • It is compatible with the MIT License
  • I have squashed any insignificant commits. (git rebase)

Detailed Description of the Pull Request / Additional comments

There was a small issue in enabling Sentinel on a workspace. Another user also opened an issue for this #192

  • The body of the request contained the text ($workspace) and not the actual workspace resource ID. This is because $workspace was between single quotes
  • The retrieval of the workspace failed as the splitting of the baseURL failed. Using $baseUri.split("") is case sensitive. Switched to $baseUri -split ("") as this is case insensitive and should prevent any issues.
  • Fixed 2 small typo's in output (Sentinetal vs Sentinel)

Validation Steps Performed

$workspace = New-AzOperationalInsightsWorkspace -location 'southeastasia' -Name 'azla-sentinel' -
Sku 'PerGB2018' -ResourceGroupName 'azrg-sentinel' -Tag @{environment = 'Development'}

Set-AzSentinel -WorkspaceName $workspace.Name -confirm:$false

How does this PR accomplish the above

Prevents the 400 error code issue

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.

Set-Sentinel returns with status code 400
1 participant