question

playstel.studio@gmail.com avatar image
playstel.studio@gmail.com asked

Cloud Scripts Not Authorized error

I have "Not Authorized" in OnCloudScriptError after installing and setup GitHub in add-ons.
I can't edit cloud scripts from automation/revision (seems is not available now). Also i tried to use Azure Functions & VS Code, but it is inconvenient to test - it has a strict deploy iterations limits and long loading time of the scripts into the cloud app.

So I would like to know how to fix the authorization error...

        public void CloudScriptTest()
        {
            PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest()
            {
                FunctionName = "helloWorld",

		//I know that it is not necessary to specify the bottom lines, but I tri		ed it in different ways:
                GeneratePlayStreamEvent = true,
                RevisionSelection = CloudScriptRevisionOption.Live,
                AuthenticationContext = new PlayFabAuthenticationContext()
                {
                    PlayFabId = playerPlayFabID,
                    EntityToken = entityToken,
                    ClientSessionTicket = sessionTicket
                },
                FunctionParameter = args

            }, OnCloudScript, OnCloudScriptError);

        }
CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

@playstel.studio@gmail.com

@vrsde

,@Alejandro Requena Diaz, @ayoub alaoui kadiri, @arflact.

For this Cloud Script Authorized error, as well as the Photon room creation error, the root cause is the deprecation of Cloud Script.

As the blog Announcing CloudScript using Azure Functions is now GA (playfab.com) mentioned, Azure Function is now GA and it is a replacement solution of Cloud Script. CloudScript classic will remain available for titles that are already using it. Using it means they should have their own revision of CloudScript. New titles, or titles considered as low use of Cloud Script, won't be able to use Cloud Script classic any longer.

If you have been using Cloud Script for a while and it is disabled by mistake, and you are in a paid subscription plan, please submit a support ticket to us.

-----

Photon

If you follow PlayFab official tutorial or Photon official PlayFab integration document to implement webhooks, there will be errors because this tutorial requires Cloud Script functions, and if your title is disabled with this feature, you are not able to use Photon. The first event is Room Create, and it is the reason you get errors when creating room and even you have passed this event, the rest of events will also throw errors. Currently there aren't any official updated documents about implementing Photon with Playfab. I will try to reach the team to discuss this issue. For now, you will need to follow Photon documentation Webhooks | Photon Engine and official repositoryPhotonEngine/photon.realtime.webhooks.serverless (github.com) to implement it with Azure Function. This is not integrated with PlayFab and will need extra efforts to make it work.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

playstel.studio@gmail.com avatar image playstel.studio@gmail.com commented ·

Thanks! In this case in Azure I reach the limit in "Storage, Files, LERS Write Operations" (1,25 / 1 (10K)) after ~10 function deploy iterations from VS Code (this function is small and consists of a single script and Azure libraries connected to it).

How is it possible to conduct further testing that requires dozens of iterations? What happens if I don't pay attention to exceeding this limit and continue to use the free service?

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ playstel.studio@gmail.com commented ·

How did you implement your Azure Functions? Are you using the above sample? Please note the above sample also uses Azure Blob & TableStorage and Notification Hub, which might be not needed for you.

1 Like 1 ·
Seth Du avatar image Seth Du ♦ playstel.studio@gmail.com commented ·

Please contact Azure support for billing issues.

1 Like 1 ·
yauheni avatar image
yauheni answered

Hi @SethDu

Maybe you can help me?

I still have a problem integrating Playfab and Photon into Unity. After successfully logging into PlayFab, I am trying to create a room using the CreateRoom command in Photon. Returns an error: Failed to create game at https: //......./RoomCreated? : Error response ResultCode = '1' Message = 'Not authorized'.

Maybe there is a solution for this problem?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.