Code Monkey home page Code Monkey logo

service-fabric-aad-helpers's People

Contributors

erikadoyle avatar jagilber avatar jeffj6123 avatar microsoftopensource avatar msftgits avatar rwike77 avatar tomvcassidy avatar v-rajagt-zz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

service-fabric-aad-helpers's Issues

Cannot send content-body with this verb-type

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

run setupapplications.ps1

Any log messages given by the failure

WARNING: invoke-graphApiCall status:
exception:
Cannot send a content-body with this verb-type.
Invoke-WebRequest : Cannot send a content-body with this verb-type.
At C:\Tools\scripts\service-fabric-aad-helpers-master\Common.ps1:239 char:19

  • ... $result = Invoke-WebRequest $uri -Method $method -Headers $headers ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ProtocolViolationException
    • FullyQualifiedErrorId : System.Net.ProtocolViolationException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

at invoke-graphApiCall, C:\Tools\scripts\service-fabric-aad-helpers-master\Common.ps1: line 239
at invoke-graphApi, C:\Tools\scripts\service-fabric-aad-helpers-master\Common.ps1: line 275
at wait-forResult, C:\Tools\scripts\service-fabric-aad-helpers-master\Common.ps1: line 302
at add-oauthPermissions, C:\Tools\scripts\service-fabric-aad-helpers-master\SetupApplications.ps1: line 285
at enable-AAD, C:\Tools\scripts\service-fabric-aad-helpers-master\SetupApplications.ps1: line 438
at main, C:\Tools\scripts\service-fabric-aad-helpers-master\SetupApplications.ps1: line 149
at , C:\Tools\scripts\service-fabric-aad-helpers-master\SetupApplications.ps1: line 653
at , : line 1

Expected/desired behavior

it should create both app registrations

OS and Version?

Win11

Versions

Mention any other details that might be useful

The script successfully creates the Cluster App, but goes into a wait loop on the client application.


Thanks! We'll be in touch soon.

Support PowerShell Core

Currently this script relies on ADAL for .NET Framework, and does not work in PowerShell Core:

New-Object : Cannot find an overload for "PlatformParameters" and the argument count: "1".
At C:\Source\MS\ADP\deploy\sf\scripts\Common.ps1:37 char:27

I suggest switching to New-AzureADApplication instead of this custom script (and updating the docs accordingly).

AcquireTokenAsync (Common.ps1) failing due to Nuget package version

This issue is for a:

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [x] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

The latest version of the Nuget package - Microsoft.IdentityModel.Clients.ActiveDirectory v5.2.8 leads to AcquireTokenAsync call failing. The documentation should be updated to install the package v4.5.1 OR update Common.ps1 to adhere to the changes introduced in v5.2.8

Any log messages given by the failure

The error message complained about no overload of the method accepting 4 arguments.

Expected/desired behavior

Scripts run without failure.

OS and Version?

Windows 10

Versions

$PSVersionTable.PSVersion

Major Minor Build Revision
5 1 19041 1

Add support for Azure Gov

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Try to create app registrations on a Azure Gov account. It fails because the $authString is incorrect for US Go deployments

Any log messages given by the failure

NA

Expected/desired behavior

The Location parameter should include a 'usgov' option to create Applications in Azure Gov

OS and Version?

Windows 10.

Versions

any

Mention any other details that might be useful

$authString should be:
$authString = "https://login.microsoftonline.us/" + $TenantId


Thanks! We'll be in touch soon.

header call is broken

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

.\SetupApplications.ps1 -TenantId '000000000000000000' -ClusterName 'cluster-name' -WebApplicationReplyUrl 'url:19080/Explorer' -AddResourceAccess

Any log messages given by the failure

Invoke-RestMethod: C:\Repos\ServiceFabric\service-fabric-aad-helpers\Common.ps1:48
Line |
48 | return (Invoke-RestMethod $uri -Method $method -Headers $headers โ€ฆ
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The format of value '' is invalid.

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Cannot convert a primitive value to the expected type 'Edm.DateTime'

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Executed Powershell to Create AD Application and got failed with below error.

Any log messages given by the failure

Below is the Error Message .

Invoke-RestMethod : {"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Cannot convert a primitive value to the expected type
'Edm.DateTime'. See the inner exception for more details."},"requestId":"091ac313-7af5-42ce-80a0-9ed114fda013","date":"2020-05-12T12:51:36"}}
At C:\GepGit\service-fabric-aad-helpers\Common.ps1:48 char:13

  • return (Invoke-RestMethod $uri -Method $method -Headers $headers  ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
      Invoke-RestMethod : {"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Cannot convert a primitive value to the expected type
      'Edm.DateTime'. See the inner exception for more details."},"requestId":"4a719b15-b111-468c-adcc-babedae1a2de","date":"2020-05-12T12:51:37"}}
      At C:\GepGit\service-fabric-aad-helpers\Common.ps1:48 char:13
  • return (Invoke-RestMethod $uri -Method $method -Headers $headers  ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Expected/desired behavior

It should execute without error

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10

Versions

EnterPrice

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Default value of WebApplicationUri isn't allowed anymore

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Run CleanupApplications.ps1 without passing -WebApplicationUri

Any log messages given by the failure

Invoke-RestMethod : {"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Values of identifierUri
s property must use a verified domain of the organization or its subdomain: 'https://ServiceFabricCluster'"},"requestId
":"81b18a03-a14f-4530-ae15-9aa5f35a5d26","date":"2021-12-02T11:53:37","values":[{"item":"PropertyName","value":"identif
ierUris"},{"item":"PropertyErrorCode","value":"HostNameNotOnVerifiedDomain"},{"item":"HostName","value":"https://Servic
eFabricCluster"}]}}
At C:\Users\######\Source\repos\service-fabric-aad-helpers\Common.ps1:48 char:13
+     return (Invoke-RestMethod $uri -Method $method -Headers $headers  ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
WARNING: Web Application Creation Failed

Expected/desired behavior

App registrations gets created with the default identifier URI (api://<appId> or api://<tenantId>/<appId>)
Or
Get an error that says WebApplicationUri is a required parameter.

OS and Version?

Windows 10

Versions

1.0.4

Mention any other details that might be useful

If no value is passed for parameter WebApplicationUri, it'll default to https://ServiceFabricCluster.
However, due to the breaking changes in Azure AD as of october 2021 it is now required that the AppId URI is in the verified domains list.

Path to 'nuget.exe' is broken

This issue is for a: (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

$Configobj = .\SetupApplications.ps1 -TenantId '0e3d2646-78b3-4711-b8be-74a381d9890c' -ClusterName 'mysftestcluster' -WebApplicationReplyUrl 'https://mysftestcluster.eastus.cloudapp.azure.com:19080/Explorer/index.html' -AddResourceAccess
.\SetupUser.ps1 -ConfigObj $Configobj -UserName 'TestUser' -Password 'P@ssword!123'
.\SetupUser.ps1 -ConfigObj $Configobj -UserName 'TestAdmin' -Password 'P@ssword!123' -IsAdmin

Any log messages given by the failure

image

Expected/desired behavior

Successful execution of script and able to execute on 'nuget.exe' in same directory.

OS and Version?

Windows 10.

Versions

Mention any other details that might be useful

Modified 'Common.ps1' with '& .\nuget.exe install $ADPackage > nuget.log
' and the script executed fine.


Thanks! We'll be in touch soon.

Cannot find an overload for "AcquireTokenAsync" and the argument count: "4"

I am getting the following error while running the script
Cannot find an overload for "AcquireTokenAsync" and the argument count: "4"
The installed version of Microsoft.IdentityModel.Clients.ActiveDirectory is 5.2.6

Cannot find an overload for "AcquireTokenAsync" and the argument count: "4".
At C:\Users\pbinil\service-fabric-aad-helpers-master\service-fabric-aad-helpers-master\Common.ps1:38 char:5

  • $accessToken = $authenticationContext.AcquireTokenAsync($resource ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodException
    • FullyQualifiedErrorId : MethodCountCouldNotFindBest

Invoke-RestMethod : {"odata.error":{"code":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access
Token missing or malformed."}}}
At C:\Users\pbinil\service-fabric-aad-helpers-master\service-fabric-aad-helpers-master\Common.ps1:48 char:13

  • return (Invoke-RestMethod $uri -Method $method -Headers $headers  ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
      eption
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
      WARNING: Web Application Creation Failed

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.