Giter Club home page Giter Club logo

azure-devops's Introduction

Create Wiki page from PR description

az repos pr show --org https://dev.azure.com/blazerua/ --id 1 --query "[description][0]" --output tsv | Out-File -FilePath .\55.md
az devops wiki page create --org https://dev.azure.com/blazerua/ --project CI --path 'Home/56' --wiki CI.wiki --file-path .\55.md --encoding utf-16le

Download artifact from latest build in pipleine

$buildId = az  pipelines build list --org https://dev.azure.com/company-name/ --project project-name --definition-ids 'id if pipeline' --status completed --query "[?contains(buildNumber, 'Name of the build')].[id]|[0]" --output tsv
az pipelines runs artifact download --org https://dev.azure.com/company-name/ --project project-name --run-id $buildId --artifact-name deploy-output --path ./

Copy to azure blob storage from script

- task: AzureCLI@2
displayName: List
inputs:
  azureSubscription: 'DEV'
  scriptType: ps
  scriptLocation: inlineScript
  inlineScript: |
        Write-Host $(System.DefaultWorkingDirectory)/web/DEV
        az storage blob upload-batch --destination web-app --account-name my-account-name  --destination-path test --source $(System.DefaultWorkingDirectory)/web/dist

Generate Azure storage share SAS code

    - task: AzureCLI@2
      displayName: List
      inputs:
        azureSubscription: 'DEV'
        scriptType: ps
        scriptLocation: inlineScript
        inlineScript: |
              $accountName='storage account name'
              az storage account keys list --account-name $accountName -g APP-WW-ENV-DEV --query "[?contains(keyName, 'key1')].[value]" --output tsv
              $accountKey=$(az storage account keys list --account-name $accountName -g APP-TR-11256-DEV --query "[?contains(keyName, 'key1')].[value]" --output tsv)
              $end=$((get-date).ToUniversalTime().AddMinutes(10).ToString("yyyy-MM-ddTHH:mm:00Z"))
              $accountName
              $accountKey
              $end
              $sas=$(az storage share generate-sas -n share-name --account-key $accountKey --account-name $accountName --https-only --permissions lr --expiry $end -o tsv)
              $sas

Resources

Query results, jmespath How to query azure resources

azure-devops's People

Contributors

khdevnet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.