This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "administratorsGroup": null, | |
| "authorization": { | |
| "scheme": "ServicePrincipal", | |
| "parameters": { | |
| "serviceprincipalid": "##ServicePrincipalId##", | |
| "authenticationType": "spnKey", | |
| "serviceprincipalkey": "##ServicePrincipalKey##", | |
| "tenantid": "##TenantId##" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"lastUpload":"2021-01-29T13:57:27.583Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Give access | |
| az rest --method post --uri 'https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2015-07-01' | |
| #Remove access | |
| $account = [email protected] | |
| az role assignment delete --assignee $account --role 'User Access Administrator' --scope '/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $PersonalAccessToken = '<Put your PAT Token>' | |
| $TeamProject = '<Project Name>' | |
| $TeamFoundationCollectionUri = 'https://dev.azure.com/<OrganizationName >' | |
| $AppRegistrationName = '<Service Principal Name>' | |
| $AppPassword = '<Service Principal Secret>' | |
| $AppSecurePassword = ConvertTo-SecureString -String:$AppPassword -AsPlainText -Force | |
| .\Install-ServiceConnectionSubscription.ps1 -PersonalAccessToken $PersonalAccessToken ` | |
| -TeamFoundationCollectionUri:$TeamFoundationCollectionUri ` | |
| -TeamProject:$TeamProject ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Creates a service connection for a subscription | |
| Please ensure you are already logged to azure using az login | |
| #> | |
| param( | |
| # Azure DevOps Personal Access Token (PAT) for the 'https://dev.azure.com/[ORG]' Azure DevOps tenancy | |
| [Parameter(Mandatory)] | |
| [string] | |
| $PersonalAccessToken, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| az login | |
| $tenantName = "contso" | |
| # Defaults to UK South | |
| .\Install-AzureEnvironment.ps1 -Environment $tenantName -Name "SharePointMSAL" | |
| # If wish to change location | |
| #.\Install-AzureEnvironment.ps1 -Environment $tenantName -Name "SharePointMSAL" -Location:'<Location>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": ".NET Core Launch (console)", | |
| "type": "coreclr", | |
| "request": "launch", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using CSharpLibrary; | |
| namespace CSharpConsole | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| LibraryProject(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace CSharpLibrary | |
| { | |
| public static class IntLibrary | |
| { | |
| public static bool NumberGreaterThan5(this string value) | |
| { | |
| Int32 intValue = 0; | |
| bool canConvert = Int32.TryParse(value, out intValue); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "environment": "<tenantName>", | |
| "name": "SharePointMSAL", | |
| "site": "<relative URL e.g, /sites/teamsite>" | |
| } |